package cn.fl.riskctrl.controller;

import cmm.comm.facade.framework.api.ISysDictionaryApiService;
import cmm.comm.facade.upload.condition.SysUlFilesRecQueryCondition;
import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.mid.core.framework.page.ListPageVO;
import cmm.mid.core.framework.page.Pager;
import cmm.web.core.framework.controller.BaseController;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.cmm.base.framework.utils.DateUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.cmm.cache.framework.utils.PropertiesCacheUtils;
import cn.fl.esign.service.IFilSignService;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.project.api.IProjectQueryApiService;
import cn.fl.project.condition.PrjOlContRecQC;
import cn.fl.project.dto.PrjOlContRecDTO;
import cn.fl.riskctrl.service.IRcCstBscInfoService;
import cn.fl.riskctrl.service.IRcCstCarInfoService;
import cn.fl.riskctrl.service.IRcCstSocialRlService;
import cn.fl.riskctrl.vo.RcCstBscInfoVO;
import cn.fl.riskctrl.vo.RcCstSocialRlVO;
import cn.fl.system.constant.SysLogConstant;
import cn.fl.system.service.ISysDictionaryService;
import cn.fl.system.service.ISysUlFilesRecService;
import cn.fl.system.vo.SysUlFilesRecVO;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import fl.constant.facade.framework.constant.DictionaryConstant;
import fl.constant.facade.framework.constant.FlowConstant;
import fl.constant.facade.framework.constant.UploadConstant;
import fl.riskctrl.facade.brdb.dto.BrApplyDTO;
import fl.riskctrl.facade.jxldb.dto.JxlApplyDTO;
import fl.riskctrl.facade.riskctrl.condition.RcCstBscInfoQC;
import fl.riskctrl.facade.riskctrl.condition.RcCstSocialRlQC;
import fl.riskctrl.facade.riskctrl.constant.EnumPrdTypCd;
import fl.riskctrl.facade.riskctrl.dto.DataResultDTO;
import fl.riskctrl.facade.tddb.dto.TdApplyDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import tc.esign.facade.esign.api.IFilSignApiService;
import tc.esign.facade.esign.condition.FilSignQueryCondition;
import tc.esign.facade.esign.dto.FilSignDTO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

/**
 * @Description: 风险控制客户基础信息表 控制层
 */
@Controller
@RequestMapping("/riskctrl/rccstbscinfo")
public class RcCstBscInfoController extends BaseController {

	private static final Logger logger = LoggerFactory.getLogger(RcCstBscInfoController.class);
	@Autowired
	private IFilSignApiService filSignApiService;
	/**
	 * RcCstBscInfo 服务层BEAN
	 */
	@Autowired
	private IRcCstBscInfoService rcCstBscInfoService;
	/**
	 * RcCstBscInfo 服务层BEAN
	 */
	@Autowired
	private IRcCstSocialRlService rcCstSocialRlService;

	@Autowired
	private ISysDictionaryApiService sysDictionaryApiService;

	@Autowired
	private ISysDictionaryService sysDictionaryService;
	/**
	 * FilSign 服务层BEAN
	 */
	@Autowired
	private IFilSignService filSignService;
	/**
	 * SysUlFilesRec 服务层BEAN
	 */
	@Autowired
	private ISysUlFilesRecService sysUlFilesRecService;
	@Autowired
	private IProjectQueryApiService projectQueryApiService;

	@Autowired
	private IRcCstCarInfoService rcCstCarInfoService;

	/**
	 * 到列表页面
	 */
	@RequestMapping(value = "/toCstChkListPage.do", method = { RequestMethod.GET})
	public ModelAndView toChkListPage(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toChkListPage", "请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/cstChkMain");
		BaseLogUtils.info(logger, "toListPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		String audStsCdDic = PropertiesCacheUtils.getProperty(FlowConstant.AUD_STS_CD);
		List<KeyValueVO> list = this.sysDictionaryApiService.getKvList(audStsCdDic, CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd());
		List<KeyValueVO> removeList = new ArrayList<KeyValueVO>();
		for (KeyValueVO keyValueVO : list) {
			if (!"2".equals(keyValueVO.getKey()) && !"3".equals(keyValueVO.getKey())) {
				removeList.add(keyValueVO);
			}
		}
		list.removeAll(removeList);
		view.addObject("audStsCdDicList", list);
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toChkListPage", "耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 到“详版-查询征信记录”列表页面
	 */
	@RequestMapping(value = "/toBfRecListPage.do", method = { RequestMethod.GET})
	public ModelAndView toBfRecListPage(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toBfRecListPage", "请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/bfRecMain");
		BaseLogUtils.info(logger, "toListPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		String certNo = request.getParameter("certNo");// 客户证件号
		String prjId = request.getParameter("prjId"); // 项目ID
		String isShowAc = request.getParameter("isShowAc");  // "1";  //request.getParameter("isShowAc"); // 是否重卡
		String audStsCdDic = PropertiesCacheUtils.getProperty(FlowConstant.AUD_STS_CD);//审批状态
		String usLevelDic = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_RCT_LVL_CD);//征信评级
		String yesNoDic = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_SYS_YES_NO_CD);//是否标识
		String prdTypCdDic = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_SPL_BUS_TYP_CD);//车型
		List<String> codeGrpCdList = new ArrayList<>();
		codeGrpCdList.add(audStsCdDic);
		codeGrpCdList.add(usLevelDic);
		codeGrpCdList.add(yesNoDic);
		// codeGrpCdList.add(prdTypCdDic);
		Map<String, List<KeyValueVO>> dicMap = this.sysDictionaryService.getMultiKvList(CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd(), codeGrpCdList);
		List<KeyValueVO> list = dicMap.get(audStsCdDic);
		List<KeyValueVO> removeList = new ArrayList<KeyValueVO>();
		for (KeyValueVO keyValueVO : list) {
			if (!"1".equals(keyValueVO.getKey()) && !"2".equals(keyValueVO.getKey()) && !"3".equals(keyValueVO.getKey())) {
				removeList.add(keyValueVO);
			}
		}
		list.removeAll(removeList);
		view.addObject("audStsCdDicList", list);

		List<KeyValueVO> usList = dicMap.get(usLevelDic);
		view.addObject("usLevelDicList", usList);

		List<KeyValueVO> yesNoList = dicMap.get(yesNoDic);
		view.addObject("yesNoDicList", yesNoList);

		// 购车类型
		List<KeyValueVO> resultList = this.sysDictionaryApiService.getKvListAll(prdTypCdDic, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());// dicMap.get(prdTypCdDic);
		List<KeyValueVO> prdTypList = new ArrayList<KeyValueVO>();
		for(KeyValueVO v: resultList){
			if(v.getKey().equals(EnumPrdTypCd.HEAVY_TRUCK.key())    // 重卡
					|| v.getKey().equals(EnumPrdTypCd.LIGHT_TRUCK.key())   // 轻卡
					|| v.getKey().equals(EnumPrdTypCd.SECONDHANDCAR.key())  // 二手车
					|| v.getKey().equals(EnumPrdTypCd.NEW_ENERGY.key())  // 新能源
					|| v.getKey().equalsIgnoreCase(EnumPrdTypCd.CDD.key())  // 车抵贷（线上）
					|| v.getKey().equalsIgnoreCase(EnumPrdTypCd.CDD_UNDER_LINE.key())  // 车抵贷（线下）
                    || v.getKey().equalsIgnoreCase(EnumPrdTypCd.LCV.key())  // LCV
                    || v.getKey().equalsIgnoreCase(EnumPrdTypCd.NEV.key())  // LCV
					|| v.getKey().equalsIgnoreCase(EnumPrdTypCd.YQXD.key())  // 疫情小贷
					){
				prdTypList.add(v);
			}
		}
		
		view.addObject("prdTypDicList", prdTypList);
		if (StringUtils.isNotEmpty(certNo)) {
			view.addObject("certNo", certNo);
		}
		if (StringUtils.isNotEmpty(prjId)) {
			view.addObject("prjId", prjId);
		}
		if (StringUtils.isNotEmpty(isShowAc)) {
			view.addObject("isShowAc", isShowAc);
		} else {
			view.addObject("isShowAc", "0");
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toBfRecListPage", "耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return view;
	}


	/**
	 * 到“预审审核-查询征信记录”列表页面
	 */
	@RequestMapping(value = "/toYsRecListPage.do", method = { RequestMethod.GET})
	public ModelAndView toYsRecListPage(HttpServletRequest request, HttpServletResponse response) {
		Long startTm = System.currentTimeMillis();
		BaseLogUtils.info(logger, "toBfRecListPage", "请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/ysRecMain");
		BaseLogUtils.info(logger, "toListPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		String certNo = request.getParameter("certNo");// 客户证件号
		String prjId = request.getParameter("prjId"); // 项目ID
		//String isShowAc = request.getParameter("isShowAc");  // "1";  //request.getParameter("isShowAc"); // 是否重卡
		String audStsCdDic = PropertiesCacheUtils.getProperty(FlowConstant.AUD_STS_CD);//审批状态
		String usLevelDic = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_RCT_LVL_CD);//征信评级
		String yesNoDic = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_SYS_YES_NO_CD);//是否标识
		String prdTypCdDic = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_SPL_BUS_TYP_CD);//车型
		List<String> codeGrpCdList = new ArrayList<>();
		codeGrpCdList.add(audStsCdDic);
		codeGrpCdList.add(usLevelDic);
		codeGrpCdList.add(yesNoDic);
		// codeGrpCdList.add(prdTypCdDic);
		Map<String, List<KeyValueVO>> dicMap = this.sysDictionaryService.getMultiKvList(CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd(), codeGrpCdList);
		List<KeyValueVO> list = dicMap.get(audStsCdDic);
		List<KeyValueVO> removeList = new ArrayList<KeyValueVO>();
		for (KeyValueVO keyValueVO : list) {
			if (!"1".equals(keyValueVO.getKey()) && !"2".equals(keyValueVO.getKey()) && !"3".equals(keyValueVO.getKey())) {
				removeList.add(keyValueVO);
			}
		}
		list.removeAll(removeList);
		view.addObject("audStsCdDicList", list);

		List<KeyValueVO> usList = dicMap.get(usLevelDic);
		view.addObject("usLevelDicList", usList);

		List<KeyValueVO> yesNoList = dicMap.get(yesNoDic);
		view.addObject("yesNoDicList", yesNoList);

		// 购车类型
		List<KeyValueVO> resultList = this.sysDictionaryApiService.getKvListAll(prdTypCdDic, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());// dicMap.get(prdTypCdDic);
		List<KeyValueVO> prdTypList = new ArrayList<KeyValueVO>();
		for(KeyValueVO v: resultList){
			if(v.getKey().equals(EnumPrdTypCd.HEAVY_TRUCK.key())    // 重卡
					|| v.getKey().equals(EnumPrdTypCd.LIGHT_TRUCK.key())   // 轻卡
					|| v.getKey().equals(EnumPrdTypCd.SECONDHANDCAR.key())  // 二手车
					|| v.getKey().equals(EnumPrdTypCd.NEW_ENERGY.key())  // 新能源
					|| v.getKey().equalsIgnoreCase(EnumPrdTypCd.CDD.key())  // 车抵贷（线上）
					|| v.getKey().equalsIgnoreCase(EnumPrdTypCd.CDD_UNDER_LINE.key())  // 车抵贷（线下）
					|| v.getKey().equalsIgnoreCase(EnumPrdTypCd.LCV.key())  // LCV
                    || v.getKey().equalsIgnoreCase(EnumPrdTypCd.NEV.key())  // NEV
					|| v.getKey().equalsIgnoreCase(EnumPrdTypCd.YQXD.key())  // 疫情小贷
			){
				prdTypList.add(v);
			}
		}

		view.addObject("prdTypDicList", prdTypList);
		if (StringUtils.isNotEmpty(certNo)) {
			view.addObject("certNo", certNo);
		}
		if (StringUtils.isNotEmpty(prjId)) {
			view.addObject("prjId", prjId);
		}
//		if (StringUtils.isNotEmpty(isShowAc)) {
//			view.addObject("isShowAc", isShowAc);
//		} else {
//			view.addObject("isShowAc", "0");
//		}
		Long endTm = System.currentTimeMillis();
		BaseLogUtils.info(logger, "toBfRecListPage", "耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return view;
	}

	
	/**
	 * 查询征信记录(客车)
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/toKcBfRecListPage.do", method = { RequestMethod.GET})
	public ModelAndView toKcBfRecListPage(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toKcBfRecListPage", " 查询征信记录.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/kcBfRecMain");
		BaseLogUtils.info(logger, "toListPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		String certNo = request.getParameter("certNo");  // "15012119860915391X";  ////客户证件号
		String prjId = request.getParameter("prjId");  // 项目ID
		String audStsCdDic = PropertiesCacheUtils.getProperty(FlowConstant.AUD_STS_CD);//审批状态
		String usLevelDic = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_RCT_LVL_CD);//征信评级
		String yesNoDic = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_SYS_YES_NO_CD);//是否标识
		String prdTypCdDic = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_SPL_BUS_TYP_CD);//车型
		List<String> codeGrpCdList = new ArrayList<>();
		codeGrpCdList.add(audStsCdDic);
		codeGrpCdList.add(usLevelDic);
		codeGrpCdList.add(yesNoDic);
		codeGrpCdList.add(prdTypCdDic);
		Map<String, List<KeyValueVO>> dicMap = this.sysDictionaryService.getMultiKvList(CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd(), codeGrpCdList);
		List<KeyValueVO> list = dicMap.get(audStsCdDic);
		List<KeyValueVO> removeList = new ArrayList<KeyValueVO>();
		for (KeyValueVO keyValueVO : list) {
			if (!"1".equals(keyValueVO.getKey()) && !"2".equals(keyValueVO.getKey()) && !"3".equals(keyValueVO.getKey())) {
				removeList.add(keyValueVO);
			}
		}
		list.removeAll(removeList);
		view.addObject("audStsCdDicList", list);

		List<KeyValueVO> usList = dicMap.get(usLevelDic);
		view.addObject("usLevelDicList", usList);

		List<KeyValueVO> yesNoList = dicMap.get(yesNoDic);
		view.addObject("yesNoDicList", yesNoList);

		List<KeyValueVO> prdTypList = dicMap.get(prdTypCdDic);
		view.addObject("prdTypDicList", prdTypList);
		if (StringUtils.isNotEmpty(certNo)) {
			view.addObject("certNo", certNo);
		}
		if (StringUtils.isNotEmpty(prjId)) {
			view.addObject("prjId", prjId);
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toKcBfRecListPage", " 查询征信记录.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 到城配前置查看规则页面
	 */
	@RequestMapping(value = "/toModifyPage.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView toModifyPage(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toModifyPage", " 到城配前置查看规则页面.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String id = request.getParameter("id");//客户ID
		String zx_flag = request.getParameter("zx_flag");//城配权限标识
		ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/modify");
		String path = PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_SERVER_PATH);
		view.addObject("zx_path", path);
		view.addObject("zx_flag", zx_flag);//默认查看全部征信内容和报告
		view.addObject("zx_prjid", id);
		view.addObject("zx_cstid", id);
		BaseLogUtils.info(logger, "toModifyPage", "跳转到重卡城配前置征信审核页面.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toModifyPage", " 到城配前置查看规则页面.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 跳转到前置征信复议页面
	 */
	@RequestMapping(value = "/toZkAudiPage.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView toZkAudiPage(HttpServletRequest request, HttpServletResponse response) {
		// 客户ID
		String id = request.getParameter("id");

		// 跳转页面标识
		String zx_flag = request.getParameter("zx_flag");
		String viewUrl = "riskctrl/rccstbscinfo/zkAudiPage2";
		if(null != zx_flag) {
			if("1".equals(zx_flag)) {
				// 完整功能
				viewUrl = "riskctrl/rccstbscinfo/zkAudiPage1";
			}
			if("2".equals(zx_flag)){
				// 仅报告
				viewUrl = "riskctrl/rccstbscinfo/zkAudiPage2";
			}
		}
		ModelAndView view = new ModelAndView(viewUrl);
		// 前置客户ID
		view.addObject("zx_cstid", id);
		// 上传文件路径
		String path = PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_SERVER_PATH);
		view.addObject("zx_path", path);

		BaseLogUtils.info(logger, "toZkAudiPage", "跳转到前置征信复议页面.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 到乘用车前置查看规则页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/toRuleDetailPage.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView toRuleDetailPage(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toRuleDetailPage", " 到乘用车前置查看规则页面.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String id = request.getParameter("id");//客户ID
		ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/riskCtrlMain");
		String path = PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_SERVER_PATH);
		view.addObject("zx_path", path);
//		view.addObject("zx_flag", 1);//默认查看全部征信内容和报告
		view.addObject("zx_prjid", id);
		view.addObject("zx_cstid", id);
		this.setCstBscInfo(id, view);
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toRuleDetailPage", " 到乘用车前置查看规则页面.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 到二手车前置查看规则页面
	 */
	@RequestMapping(value = "/toEscAudiPage.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView toEscAudiPage(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toEscAudiPage", " 加载Demo列表页面.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String id = request.getParameter("id");//客户ID
		String zx_flag = request.getParameter("zx_flag");//城配权限标识
		ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/escAudiPage");
		String path = PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_SERVER_PATH);
		view.addObject("zx_path", path);
		view.addObject("zx_flag", zx_flag);//默认查看全部征信内容和报告
		view.addObject("zx_prjid", id);
		view.addObject("zx_cstid", id);
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toEscAudiPage", " 加载Demo列表页面.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return view;
	}
	
	/**
	 * 跳转客车复议页面
	 */
	@RequestMapping(value = "/toKcAudiPage.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView toKcAudiPage(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toKcAudiPage", " 跳转到二手车前置征信审核页面.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String id = request.getParameter("id");//客户ID

		String zx_flag = request.getParameter("zx_flag");
		String viewUrl = "riskctrl/rccstbscinfo/kcAudiPage2";
		if(null != zx_flag){
			if("1".equals(zx_flag)) {
				// 复议
				viewUrl = "riskctrl/rccstbscinfo/kcAudiPage1";
			}
			if("2".equals(zx_flag)) {
				// 查看
				viewUrl = "riskctrl/rccstbscinfo/kcAudiPage2";
			}
		}
		ModelAndView view = new ModelAndView(viewUrl);

		String path = PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_SERVER_PATH);
		view.addObject("zx_path", path);
		view.addObject("zx_cstid", id);
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toKcAudiPage", " 跳转到二手车前置征信审核页面.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return view;
	}

    /**
     * 获取同盾手机报告
     */
    @RequestMapping(value = "/toTDMPReport.do", method = { RequestMethod.GET, RequestMethod.POST })
    public ModelAndView toMPReport(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toMPReport", " 获取同盾手机报告.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
        System.out.println("toTDMPReport");
        String cstId = request.getParameter("id");//客户ID
        String reportType = request.getParameter("reportType"); // report类型 ？？？
        ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/kcTdReport");
        DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
        List<TdApplyDTO> list =new ArrayList<>();
        if(StringUtils.isNotEmpty(cstId)){
            try {
                DataResultDTO resultData = this.rcCstBscInfoService.getMPReportInfo(Long.valueOf(cstId),reportType);
                list= (List<TdApplyDTO>)resultData.getData();
            } catch (BaseException ex) {
                ex.getStackTrace();
                result.setSuccess(BaseConstant.IS_YESNO_NO);
                result.setInfo(ex.getMessage());
                BaseLogUtils.info(logger, "getSynthIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getStackTrace(), CurrentThreadContext.getCurrentUserName());
            } catch (Exception ex) {
                ex.getStackTrace();
                result.setSuccess(BaseConstant.IS_YESNO_NO);
                result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
                BaseLogUtils.error(logger, "getSynthIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getStackTrace(), CurrentThreadContext.getCurrentUserName());
            }
        }
        view.addObject("tdApplyDTOList",list);  // 默认查看全部征信内容和报告
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toMPReport", " 获取同盾手机报告.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
        return view;
    }

	/**
     * 获取聚信立手机报告
     */
    @RequestMapping(value = "/toJxlReport.do", method = { RequestMethod.GET, RequestMethod.POST })
    public ModelAndView toJxlReport(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toJxlReport", " 获取聚信立报告.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
        System.out.println("toJxlReport");
        String cstId = request.getParameter("id");//客户ID
        String reportType = request.getParameter("reportType"); // report类型 ？？？
        ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/kcJxlReport");
        DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
        List<JxlApplyDTO> list =new ArrayList<>();
        if(StringUtils.isNotEmpty(cstId)){
            try {
                DataResultDTO resultData = this.rcCstBscInfoService.getMPReportInfo(Long.valueOf(cstId),reportType);
                list=(List<JxlApplyDTO>)resultData.getData();
            } catch (BaseException ex) {
                ex.getStackTrace();
                result.setSuccess(BaseConstant.IS_YESNO_NO);
                result.setInfo(ex.getMessage());
                BaseLogUtils.info(logger, "toJxlReport", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getStackTrace(), CurrentThreadContext.getCurrentUserName());
            } catch (Exception ex) {
                ex.getStackTrace();
                result.setSuccess(BaseConstant.IS_YESNO_NO);
                result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
                BaseLogUtils.error(logger, "toJxlReport", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getStackTrace(), CurrentThreadContext.getCurrentUserName());
            }
        }
        view.addObject("jxlApplyDTOList",list);  // 默认查看全部征信内容和报告
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toJxlReport", " 获取聚信立报告.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
        return view;
    }

	/**
     * 获取百融手机报告
     */
    @RequestMapping(value = "/toBrReport.do", method = { RequestMethod.GET, RequestMethod.POST })
    public ModelAndView toBrReport(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toBrReport", " 获取百融报告.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
        System.out.println("toBrReport");
        String cstId = request.getParameter("id");//客户ID
        String reportType = request.getParameter("reportType"); // report类型 ？？？
        ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/kcBrReport");
        DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
        List<BrApplyDTO> list =new ArrayList<>();
        if(StringUtils.isNotEmpty(cstId)){
            try {
                DataResultDTO resultData = this.rcCstBscInfoService.getMPReportInfo(Long.valueOf(cstId),reportType);
                list=(List<BrApplyDTO>)resultData.getData();
            } catch (BaseException ex) {
                ex.getStackTrace();
                result.setSuccess(BaseConstant.IS_YESNO_NO);
                result.setInfo(ex.getMessage());
                BaseLogUtils.info(logger, "toBrReport", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getStackTrace(), CurrentThreadContext.getCurrentUserName());
            } catch (Exception ex) {
                ex.getStackTrace();
                result.setSuccess(BaseConstant.IS_YESNO_NO);
                result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
                BaseLogUtils.error(logger, "toBrReport", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getStackTrace(), CurrentThreadContext.getCurrentUserName());
            }
        }
        
        view.addObject("brApplyDTOList",list);  // 默认查看全部征信内容和报告
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toBrReport", " 获取百融报告.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
        return view;
    }

	/**
	 * 修改
	 */
	@RequestMapping(value = "/modify.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object modify(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "modify", " 修改.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String flag = request.getParameter("flag");//是否发送信息
		String id = request.getParameter("id");
		String audOpinion = request.getParameter("audOpinion");
		String audOpinion2 = request.getParameter("audOpinion2");
		String rskLvlCd2 = request.getParameter("rskLvlCd");
		String audStsDesc = request.getParameter("audStsDesc");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES,SysLogConstant.LOG_CMM_UPDATE_SUCC);
		RcCstBscInfoVO entity = new RcCstBscInfoVO();
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "modify", "征信前置客户信息,主键参数为空！.ID:"+id, CurrentThreadContext.getCurrentUserName());
			return result;
		}
		try {
			if (StringUtils.isNotEmpty(id)) {
				entity.setId(Long.valueOf(id));
			}
			if (audOpinion != null) {
				entity.setAudOpinion(audOpinion.trim());
			}
			if (audOpinion2 != null) {
				entity.setAudOpinion2(audOpinion2.trim());
			}
			if (audStsDesc != null) {
				entity.setAudStsDesc(audStsDesc.trim());
			}
			// 审核结果
			if (StringUtils.isNotEmpty(rskLvlCd2)) {
				if(rskLvlCd2.equals("4")||rskLvlCd2.equals("5")){
					entity.setRskLvlCd("1");
				}else{
					entity.setRskLvlCd(rskLvlCd2.trim());
				}
				entity.setRskLvlCd2(rskLvlCd2.trim());
				String audPass = PropertiesCacheUtils.getProperty(FlowConstant.FLOW_CHECK_STATE_PASS);
				String audNoPass = PropertiesCacheUtils.getProperty(FlowConstant.FLOW_CHECK_STATE_NO_PASS);
				if ("1".equals(rskLvlCd2.trim()) || "2".equals(rskLvlCd2.trim())|| "4".equals(rskLvlCd2.trim())|| "5".equals(rskLvlCd2.trim())) {
					// A级通过、B级有条件通过、
					entity.setAudStsCd(audPass);  // 通过
				} else if ("3".equals(rskLvlCd2.trim())) {
					// C级直接拒单
					entity.setAudStsCd(audNoPass);  // 不通过
				}
			}
			entity.setIsReaud(0);  // 清除复议标识：无需再次复议
			entity.setMdfTm(new Date());
			entity.setMdfUsrId(CurrentThreadContext.getCurrentUserId());
			boolean success = this.rcCstBscInfoService.modify(entity, flag);
			if(!success){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_UPDATE_FAIL);
				BaseLogUtils.info(logger, "modify", "征信前置客户信息失败.DATA:"+JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
			} else {
				BaseLogUtils.info(logger, "modify", "征信前置客户信息成功.DATA:"+JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
			}
			//修改车牌号等级
			DataResultVO resultDto = rcCstCarInfoService.exeCarInfo(Long.valueOf(id),rskLvlCd2);
			if(BaseConstant.IS_YESNO_NO==resultDto.getSuccess()){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_UPDATE_FAIL);
				BaseLogUtils.info(logger, "modify", "征信前置客户信息失败.DATA:"+JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
			}

		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "modify", "征信前置客户信息失败.DATA:"+JSONObject.toJSONString(entity)+".ERROR:"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "modify", "征信前置客户信息失败,系统错误.DATA:"+JSONObject.toJSONString(entity)+".ERROR:"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "modify", " 修改.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取风控数据
	 */
	@RequestMapping(value = "/getRiskCtrlData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getRiskCtrlData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getRiskCtrlData", " 获取风控数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID

		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getRiskCtrlData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.getRiskCtrlIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			BaseLogUtils.error(logger, "-", "异常", ex);
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getRiskCtrlData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			BaseLogUtils.error(logger, "-", "异常", ex);
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getRiskCtrlData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getRiskCtrlData", " 获取风控数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取中智诚数据
	 */
	@RequestMapping(value = "/getZZCIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getZZCIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getZZCIsCorrectData", " 获取中智诚数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getZZCIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkZZCIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getZZCIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getZZCIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getZZCIsCorrectData", " 获取中智诚数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取信加数据
	 */
	@RequestMapping(value = "/getXjIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getXjIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getXjIsCorrectData", " 获取信加数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getXjIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkXjIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getXjIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getXjIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getXjIsCorrectData", " 获取信加数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

    /**
     * 获取信加本地规则
     */
    @RequestMapping(value = "/getXjLocalDataBaseIsCorrectData.do", method = { RequestMethod.GET })
    @ResponseBody
    public Object getXjLocalDataBaseIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getXjIsCorrectData", " 获取信加数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
        String cstId = request.getParameter("cstId");//客户ID
        DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
        if (StringUtils.isEmpty(cstId)) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo("获取征信数据客户ID不能为空!");
            BaseLogUtils.info(logger, "getXjIsCorrectData", this.getRequestParameter(request));
            return result;
        }
        try {
            DataResultDTO data = this.rcCstBscInfoService.getXjLocalDataBaseIsCorrectData(Long.valueOf(cstId));
            result.setData(data.getData());
        } catch (BaseException ex) {
            ex.getStackTrace();
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo(ex.getMessage());
            BaseLogUtils.info(logger, "getXjIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
        } catch (Exception ex) {
            ex.getStackTrace();
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
            BaseLogUtils.error(logger, "getXjIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
        }
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getXjIsCorrectData", " 获取信加数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
        return result;
    }
	/**
	 * 获取三方手机认证数据
	 */
	@RequestMapping(value = "/getSynthMobileIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getSynthMobileIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getSynthMobileIsCorrectData", " 获取三方手机认证数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getMobileIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkSynthMobileIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getMobileIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getMobileIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getSynthMobileIsCorrectData", " 获取三方手机认证数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取三方综合评分
	 */
	@RequestMapping(value = "/getSynthScoreIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getSynthScoreIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getSynthScoreIsCorrectData", " 获取三方综合评分.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getSynthIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkSynthScoreIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getSynthIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getSynthIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getSynthScoreIsCorrectData", " 获取三方综合评分.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}
	
	/**
	 * 专车·客车： 百融案件
	 * @param request
	 * @param response
	 * @return
	 * @throws BaseException
	 */
	@RequestMapping(value = "/getKcBadInfoCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getKcBadInfoCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getKcBadInfoCorrectData", " 百融案件.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getSynthIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkKcBadInfoIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getSynthIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getSynthIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getKcBadInfoCorrectData", " 百融案件.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取鹏元建议数据
	 */
	@RequestMapping(value = "/getPYJyIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getPYJyIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPYJyIsCorrectData", " 获取鹏元建议数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getPYJyIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkPYJyIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getPYJyIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getPYJyIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPYJyIsCorrectData", " 获取鹏元建议数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取鹏元驾照数据
	 */
	@RequestMapping(value = "/getPYJzIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getPYJzIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPYJzIsCorrectData", " 获取鹏元驾照数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getPYJzIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkPYJzIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getPYJzIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getPYJzIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPYJzIsCorrectData", " 获取鹏元驾照数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取鹏元卡交易数据
	 */
	@RequestMapping(value = "/getKJYIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getKJYIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getKJYIsCorrectData", " 获取鹏元卡交易数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getKJYIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkKJYIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getKJYIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getKJYIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getKJYIsCorrectData", " 获取鹏元卡交易数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取鹏元手机核查数据
	 */
	@RequestMapping(value = "/getSYSIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getSYSIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getSYSIsCorrectData", " 获取鹏元手机核查数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getSYSIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkSYSIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getSYSIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getSYSIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getSYSIsCorrectData", " 获取鹏元手机核查数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取鹏元学历核查数据
	 */
	@RequestMapping(value = "/getPyEduIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getPyEduIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPyEduIsCorrectData", " 获取鹏元学历核查数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getPyEduIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkPyEduIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getPyEduIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getPyEduIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPyEduIsCorrectData", " 获取鹏元学历核查数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取鹏元分数据
	 */
	@RequestMapping(value = "/getPyscrIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getPyscrIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPyscrIsCorrectData", " 获取鹏元分数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getPyscrIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkPyscrIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getPyscrIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getPyscrIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPyscrIsCorrectData", " 获取鹏元分数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取聚信立分数据
	 */
	@RequestMapping(value = "/getJXLIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getJXLIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getJXLIsCorrectData", " 获取聚信立分数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getJXLIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkJXLIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getJXLIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getJXLIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getJXLIsCorrectData", " 获取聚信立分数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取百融分数据
	 */
	@RequestMapping(value = "/getBrIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getBrIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrIsCorrectData", " 获取百融分数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getBrIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkBrIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getBrIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getBrIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrIsCorrectData", " 获取百融分数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取鹏元建议数据
	 */
	@RequestMapping(value = "/getBrblIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getBrblIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrblIsCorrectData", " 获取鹏元建议数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getBrblIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkBrblIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getBrblIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getBrblIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrblIsCorrectData", " 获取鹏元建议数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取百融个人信息关联数据
	 */
	@RequestMapping(value = "/getBrPersonIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getBrPersonIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrPersonIsCorrectData", " 获取百融个人信息关联数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getBrPersonIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkBrPersonIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getBrPersonIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getBrPersonIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrPersonIsCorrectData", " 获取百融个人信息关联数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取百融手机核查数据
	 */
	@RequestMapping(value = "/getBrtelIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getBrtelIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrtelIsCorrectData", " 获取百融手机核查数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getBrtelIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkBrtelIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getBrtelIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getBrtelIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrtelIsCorrectData", " 获取百融手机核查数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取同盾手机核查数据
	 */
	@RequestMapping(value = "/getTdtelIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getTdtelIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getTdtelIsCorrectData", " 获取同盾手机核查数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getTdtelIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkTdtelIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getTdtelIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getTdtelIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getTdtelIsCorrectData", " 获取同盾手机核查数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取同盾分数据
	 */
	@RequestMapping(value = "/getTDIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getTDIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getTDIsCorrectData", " 获取同盾分数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String cstId = request.getParameter("cstId");//客户ID
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(cstId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("获取征信数据客户ID不能为空!");
			BaseLogUtils.info(logger, "getTDIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			DataResultDTO data = this.rcCstBscInfoService.checkTDIsCorrect(Long.valueOf(cstId));
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getTDIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getTDIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getTDIsCorrectData", " 获取同盾分数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}
	
	/**
	 * 到列表页面
	 */
	@RequestMapping(value = "/toRcCstBscInfoMgtListPage.do", method = { RequestMethod.GET})
	public ModelAndView toRcCstBscInfoMgtListPage(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toRcCstBscInfoMgtListPage", " 到列表页面.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		ModelAndView view = new ModelAndView("riskctrl/rccstbscinfo/rcCstBscInfoMgtList");
		try {
			String sysCd = CurrentThreadContext.getFlServiceSysCd();
			String orgCd = CurrentThreadContext.getCurrentOrgCd();
			String ynCd = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_SYS_YES_NO_CD);
			List<KeyValueVO> yNCDList = this.sysDictionaryApiService.getKvList(ynCd, sysCd, orgCd);
			if(CollectionUtils.isNotEmpty(yNCDList)){
				view.addObject("YNCdList", yNCDList);
			}
		} catch (Exception e) {
			BaseLogUtils.error(logger, "toRcCstBscInfoMgtListPage", "获取数据字段错误", e);
		}
		BaseLogUtils.info(logger, "toRcCstBscInfoMgtListPage", "跳转到前置征信客户列表页面.", CurrentThreadContext.getCurrentUserName());
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toRcCstBscInfoMgtListPage", " 到列表页面.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return view;
	}
	
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initRcCstBscInfoMgtList.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object initRcCstBscInfoMgtList(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "initRcCstBscInfoMgtList", " 请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		String cstNm = request.getParameter("cstNm");
		String mp = request.getParameter("mp");
		String splNm = request.getParameter("splNm");
		String certNo = request.getParameter("certNo");//客户证件号
		String livAudStsCd = request.getParameter("livAudStsCd");//活体状态
		String audStsCd = request.getParameter("audStsCd");//审核状态
		String rskLvlCd2 = request.getParameter("rskLvlCd");//用户级别
		String isReaud = request.getParameter("isReaud");//是否复议
		String isDl = request.getParameter("isDl");//是否死亡
		String prdTyp = request.getParameter("prdTyp");//车型
		Pager page = new Pager();
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}

		if (StringUtils.isNotEmpty(pageSize)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}

		RcCstBscInfoQC qc = new RcCstBscInfoQC();
		qc.setSysCd(CurrentThreadContext.getFlServiceSysCd());
		qc.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
		if (StringUtils.isNotEmpty(cstNm)) {
			qc.setCstNm(cstNm);
		}
		if (StringUtils.isNotEmpty(mp)) {
			qc.setMp1(mp);
			qc.setMp2(mp);
		}
		if (StringUtils.isNotEmpty(splNm)) {
			qc.setSplNm(splNm);
		}
		if (StringUtils.isNotEmpty(certNo)) {
			qc.setCertNo(certNo);
		}
		if (StringUtils.isNotEmpty(livAudStsCd)) {
			qc.setLivAudStsCd(livAudStsCd);
		}
		if (StringUtils.isNotEmpty(audStsCd)) {
			qc.setAudStsCd(audStsCd);
		}
		if (StringUtils.isNotEmpty(rskLvlCd2)) {
			qc.setRskLvlCd2(rskLvlCd2);
		}
		if (StringUtils.isNotEmpty(isReaud)) {
			qc.setIsReaud(Integer.valueOf(isReaud));
		}
		if(StringUtils.isNotEmpty(isDl) && StringUtils.isNumeric(isDl)){
			qc.setIsDl(Integer.valueOf(isDl));
		}
		if (StringUtils.isNotEmpty(prdTyp)) {
			qc.setPrdTypCd(prdTyp);
		}
		//加入数据权限
		qc.setIsAuth(true);
		qc.setCurrUsrId(CurrentThreadContext.getCurrentUserId());
		qc.setOpUsrId(CurrentThreadContext.getCurrentUserId());
		page.setCondition(qc);
		Pager pager = this.rcCstBscInfoService.searchListPage(page);
		List<RcCstBscInfoVO> list = (List<RcCstBscInfoVO>) pager.getResultList();
		
		List<Long> cstIdList = new ArrayList<>();
		//查询图片信息
		List<String> pkList = new ArrayList<String>();
		for (RcCstBscInfoVO rcCstBscInfoVO : list) {
			pkList.add(String.valueOf(rcCstBscInfoVO.getId()));
			cstIdList.add(rcCstBscInfoVO.getId());
		}
		//获取授权书关联信息
		getProjectRcCstBseInfo(list);
		
		
		SysUlFilesRecQueryCondition condition = new SysUlFilesRecQueryCondition();
		condition.setPkIdList(pkList);
		condition.setSysCd(CurrentThreadContext.getCurrentSysCd());//系统代码-必须条件
		
		List<SysUlFilesRecVO> sysUlFilesRecList = this.sysUlFilesRecService.searchList(condition);
		Map<String, SysUlFilesRecVO> mapRctOne = new HashMap<String, SysUlFilesRecVO>();
		Map<String, SysUlFilesRecVO> mapRctTwo = new HashMap<String, SysUlFilesRecVO>();
		Map<String, SysUlFilesRecVO> cfgCstIdCdMap = new HashMap<>();
		String cfgcdOne = PropertiesCacheUtils.getProperty(UploadConstant.CFG_RCT_CST_BSC_CD);
		String cfgcdTwo = PropertiesCacheUtils.getProperty(UploadConstant.CFG_RCT_LIV_LST_CD);
		String cfgCstIdCd = PropertiesCacheUtils.getProperty(UploadConstant.CFG_CST_ID_CD);
		String cfgDtlCstIdCd = PropertiesCacheUtils.getProperty(UploadConstant.CFG_DTL_CST_ID_CD);
		for (SysUlFilesRecVO sysUlFilesRecVO: sysUlFilesRecList) {
			String pkId = sysUlFilesRecVO.getPkId();
			String cfgcd = sysUlFilesRecVO.getCfgCd();
			String cfgDtlCd = sysUlFilesRecVO.getCfgDtlCd();
			if (cfgcdOne != null && cfgcdOne.equals(cfgcd)) {
				mapRctOne.put(pkId, sysUlFilesRecVO);
			}
			if (cfgcdTwo != null && cfgcdTwo.equals(cfgcd)) {
				mapRctTwo.put(pkId, sysUlFilesRecVO);
			}
			//身份证图片
			if (cfgCstIdCd != null && cfgCstIdCd.equals(cfgcd) && cfgDtlCd.equals(cfgDtlCstIdCd)) {
				cfgCstIdCdMap.put(pkId, sysUlFilesRecVO);
			}
			
		}
		for (RcCstBscInfoVO rcCstBscInfoVO : list) {
			String cstId = String.valueOf(rcCstBscInfoVO.getId());
			if (!mapRctOne.isEmpty() && mapRctOne.get(cstId) != null) {
				rcCstBscInfoVO.setAuthFileNm(mapRctOne.get(cstId).getFileNm());
				rcCstBscInfoVO.setAuthFilePath(mapRctOne.get(cstId).getFilePath());
			} else {
				rcCstBscInfoVO.setAuthFileNm("");
				rcCstBscInfoVO.setAuthFilePath("");
			}
			if (!mapRctTwo.isEmpty() && mapRctTwo.get(cstId) != null) {
				rcCstBscInfoVO.setFileNm(mapRctTwo.get(cstId).getFileNm());
				rcCstBscInfoVO.setFilePath(mapRctTwo.get(cstId).getFilePath());
			} else {
				rcCstBscInfoVO.setFileNm("");
				rcCstBscInfoVO.setFilePath("");
			}
			if(!cfgCstIdCdMap.isEmpty() && cfgCstIdCdMap.get(cstId) != null){
				rcCstBscInfoVO.setIdCardFileNm(cfgCstIdCdMap.get(cstId).getFileNm());
				rcCstBscInfoVO.setIdCardFilePath(cfgCstIdCdMap.get(cstId).getFilePath());
			}else{
				rcCstBscInfoVO.setIdCardFileNm("");
				rcCstBscInfoVO.setIdCardFilePath("");
			}
		}
		ListPageVO<RcCstBscInfoVO> listPage = new ListPageVO<RcCstBscInfoVO>(list, pager.getTotalCount());
		BaseLogUtils.info(logger, "initRcCstBscInfoMgtList", "查询数据完成. DATA:" + JSONObject.toJSONString(page), CurrentThreadContext.getCurrentUserName());
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "initRcCstBscInfoMgtList", "耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return listPage;
	}
	
	/**
	 * 初始化客户关系列表
	 */
	@RequestMapping(value = "/initCstSocialList.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object initCstSocialList(String cstId){
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "initCstSocialList", " 初始化客户关系列表.请求参数：");
		RcCstSocialRlQC qc = new RcCstSocialRlQC();
		if(StringUtils.isEmpty(cstId)){
			return new Object();
		}
		qc.setCstId(Long.valueOf(cstId));
		List<RcCstSocialRlVO> list = rcCstSocialRlService.searchRcCstSocialRlList(qc);
		if(CollectionUtils.isNotEmpty(list)){
			
			//获取征信授权书链接
			List<Long> cstIdList = new ArrayList<>();
			List<String> pkIdList = new ArrayList<>();
			//查询图片信息
			for (RcCstSocialRlVO rcCstSocialRlVO : list) {
				cstIdList.add(rcCstSocialRlVO.getId());
				pkIdList.add(String.valueOf(rcCstSocialRlVO.getId()));
			}
			PrjOlContRecQC prjQc = new PrjOlContRecQC();
			prjQc.setPkIdList(pkIdList);
			prjQc.setTabNm("RC_CST_SOCIAL_RL");
			List<PrjOlContRecDTO> searchPrjOlContRecDTOList = projectQueryApiService.searchPrjOlContRecDTOList(prjQc);
			if(CollectionUtils.isNotEmpty(searchPrjOlContRecDTOList)){
				for(RcCstSocialRlVO info : list){
					for(PrjOlContRecDTO dto : searchPrjOlContRecDTOList){
						if(String.valueOf(info.getId()).equals(dto.getPkId())){
							info.setZxFilePathStatus("1");
						}
					}
				}
			}
		}
		
		ListPageVO<RcCstSocialRlVO> listPage = new ListPageVO<RcCstSocialRlVO>(list, list.size());
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "initCstSocialList", " 初始化客户关系列表.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return listPage;
	}
	
	/**
	 * 下载征信授权书
	 * @param request
	 * @param response
	 * @return
	 * @throws BaseException
	 */
	@RequestMapping(value = "/getFilPath.do", method = {RequestMethod.GET, RequestMethod.POST })
	@ResponseBody
	public DataResultVO getPath(HttpServletRequest request, HttpServletResponse response)throws BaseException{
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPath", " 下载征信授权书.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_ADD_SUCC);
		String filId = request.getParameter("filId");
		if(StringUtils.isEmpty(filId)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("参数为空");
		}
		FilSignDTO dto = new FilSignDTO();
		dto.setFilId(Long.valueOf(filId));
		FilSignDTO resuDto = this.filSignService.downLoad(dto);
		if(resuDto != null && StringUtils.isNotEmpty(resuDto.getFilePath())){
			result.setInfo(resuDto.getFilePath());
            Long endTm = System.currentTimeMillis();
            BaseLogUtils.info(logger, "getRhAudSts", " 查人行状态.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
			return result;
		}else{
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			if(StringUtils.isNotEmpty(resuDto.getRebackMessage())){
				result.setInfo(resuDto.getRebackMessage());
			}else{
				result.setInfo("未查到合同信息！");
			}
			BaseLogUtils.info(logger, "getPath", "下载失败");
            Long endTm = System.currentTimeMillis();
            BaseLogUtils.info(logger, "getPath", " 下载征信授权书.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
			return result;
		}
	}

	/**
	 * 初始化列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initList.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object initList(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toListPage", " 初始化列表.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		String cstNm = request.getParameter("cstNm");
		String mp = request.getParameter("mp");
		String splNm = request.getParameter("splNm");
		String certNo = request.getParameter("certNo");//客户证件号
		String certNo3 = request.getParameter("certNo3");//客户证件号
		String livAudStsCd = request.getParameter("livAudStsCd");//活体状态
		String audStsCd = request.getParameter("audStsCd");//审核状态
		String rskLvlCd2 = request.getParameter("rskLvlCd");//用户级别
		String isReaud = request.getParameter("isReaud");//是否复议
		String isDl = request.getParameter("isDl");//是否死亡
		String prdTyp = request.getParameter("prdTyp");//车型
        String carNo = request.getParameter("carNo");//车型
        String cstMgrNm = request.getParameter("cstMgrNm");//车型
		String begin = request.getParameter("stDt");//开始时间
		String end  = request.getParameter("endDt");//结束时间
		String channelNm = request.getParameter("channelNm");//挂靠公司名称
		Pager page = new Pager();
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}

		if (StringUtils.isNotEmpty(pageSize)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}

		RcCstBscInfoQC qc = new RcCstBscInfoQC();
		qc.setSysCd(CurrentThreadContext.getFlServiceSysCd());
		qc.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
		if (StringUtils.isNotEmpty(cstNm)) {
			qc.setCstNm(cstNm);
		}
		if (StringUtils.isNotEmpty(mp)) {
			qc.setMp1(mp);
			qc.setMp2(mp);
		}
		if (StringUtils.isNotEmpty(splNm)) {
			qc.setSplNm(splNm);
		}
		if (StringUtils.isNotEmpty(certNo)) {
			qc.setCertNo(certNo);
		}
		if (StringUtils.isNotEmpty(certNo3)) {
			qc.setCertNo(certNo3);
		}
		if (StringUtils.isNotEmpty(livAudStsCd)) {
			qc.setLivAudStsCd(livAudStsCd);
		}
		if (StringUtils.isNotEmpty(audStsCd)) {
			qc.setAudStsCd(audStsCd);
		}
		if (StringUtils.isNotEmpty(rskLvlCd2)) {
			qc.setRskLvlCd2(rskLvlCd2);
		}
		if (StringUtils.isNotEmpty(isReaud)) {
			qc.setIsReaud(Integer.valueOf(isReaud));
		}
		if(StringUtils.isNotEmpty(isDl) && StringUtils.isNumeric(isDl)){
			qc.setIsDl(Integer.valueOf(isDl));
		}
		if(StringUtils.isNotEmpty(begin) ){
			Date beginDate = DateUtils.formatStringToDate(begin, DateUtils.YYYY_MM_DD);
			qc.setCrtDtMin(beginDate);
		}
		if(StringUtils.isNotEmpty(end)){
			Date endDate = DateUtils.formatStringToDate(end, DateUtils.YYYY_MM_DD);
			qc.setCrtDtMax(endDate);
		}
		if(StringUtils.isNotEmpty(carNo)){
		    qc.setCarNo(carNo);
        }
        if(StringUtils.isNotEmpty(cstMgrNm)){
            qc.setCstMgrNm(cstMgrNm);
        }

		if (StringUtils.isNotEmpty(channelNm)) {
			qc.setChannelNm(channelNm.trim());
		}
		if (StringUtils.isNotEmpty(prdTyp)) {
			qc.setPrdTypCd(prdTyp);
		} else {
			List<String> prdTypCds = new ArrayList<String>();
			prdTypCds.add("1");
			prdTypCds.add("2");
			prdTypCds.add("5");
			prdTypCds.add("7");
			prdTypCds.add("cdd");
			prdTypCds.add("cddunderline");
			prdTypCds.add("lcv");
            prdTypCds.add("nev");
			prdTypCds.add("yqxd");
			qc.setPrdTypCdList(prdTypCds);
		}
		//加入数据权限
		qc.setIsAuth(true);
		qc.setCurrUsrId(CurrentThreadContext.getCurrentUserId());
		qc.setOpUsrId(CurrentThreadContext.getCurrentUserId());
		page.setCondition(qc);
		BaseLogUtils.info(logger, "initList", "征信记录查询:page="+JSON.toJSONString(page));
		Pager pager = this.rcCstBscInfoService.searchListPage(page);
		List<RcCstBscInfoVO> list = (List<RcCstBscInfoVO>) pager.getResultList();
		
		List<Long> cstIdList = new ArrayList<>();
		//查询图片信息
		List<String> pkList = new ArrayList<String>();
		for (RcCstBscInfoVO rcCstBscInfoVO : list) {
			pkList.add(String.valueOf(rcCstBscInfoVO.getId()));
			cstIdList.add(rcCstBscInfoVO.getId());
		}
		//获取授权书关联信息
		getProjectRcCstBseInfo(list);
		
		
		SysUlFilesRecQueryCondition condition = new SysUlFilesRecQueryCondition();
		condition.setPkIdList(pkList);
		condition.setSysCd(CurrentThreadContext.getCurrentSysCd());//系统代码-必须条件
		
		List<SysUlFilesRecVO> sysUlFilesRecList = this.sysUlFilesRecService.searchList(condition);
		Map<String, SysUlFilesRecVO> mapRctOne = new HashMap<String, SysUlFilesRecVO>();
		Map<String, SysUlFilesRecVO> mapRctTwo = new HashMap<String, SysUlFilesRecVO>();
		Map<String, SysUlFilesRecVO> cfgCstIdCdMap = new HashMap<>();
		String cfgcdOne = PropertiesCacheUtils.getProperty(UploadConstant.CFG_RCT_CST_BSC_CD);
		String cfgcdTwo = PropertiesCacheUtils.getProperty(UploadConstant.CFG_RCT_LIV_LST_CD);
		String cfgCstIdCd = PropertiesCacheUtils.getProperty(UploadConstant.CFG_CST_ID_CD);
		String cfgDtlCstIdCd = PropertiesCacheUtils.getProperty(UploadConstant.CFG_DTL_CST_ID_CD);
		for (SysUlFilesRecVO sysUlFilesRecVO: sysUlFilesRecList) {
			String pkId = sysUlFilesRecVO.getPkId();
			String cfgcd = sysUlFilesRecVO.getCfgCd();
			String cfgDtlCd = sysUlFilesRecVO.getCfgDtlCd();
			if (cfgcdOne != null && cfgcdOne.equals(cfgcd)) {
				mapRctOne.put(pkId, sysUlFilesRecVO);
			}
			if (cfgcdTwo != null && cfgcdTwo.equals(cfgcd)) {
				mapRctTwo.put(pkId, sysUlFilesRecVO);
			}
			//身份证图片
			if (cfgCstIdCd != null && cfgCstIdCd.equals(cfgcd) && cfgDtlCd.equals(cfgDtlCstIdCd)) {
				cfgCstIdCdMap.put(pkId, sysUlFilesRecVO);
			}
			
		}
		for (RcCstBscInfoVO rcCstBscInfoVO : list) {
			String cstId = String.valueOf(rcCstBscInfoVO.getId());
			if (!mapRctOne.isEmpty() && mapRctOne.get(cstId) != null) {
				rcCstBscInfoVO.setAuthFileNm(mapRctOne.get(cstId).getFileNm());
				rcCstBscInfoVO.setAuthFilePath(mapRctOne.get(cstId).getFilePath());
			} else {
				rcCstBscInfoVO.setAuthFileNm("");
				rcCstBscInfoVO.setAuthFilePath("");
			}
			if (!mapRctTwo.isEmpty() && mapRctTwo.get(cstId) != null) {
				rcCstBscInfoVO.setFileNm(mapRctTwo.get(cstId).getFileNm());
				rcCstBscInfoVO.setFilePath(mapRctTwo.get(cstId).getFilePath());
			} else {
				rcCstBscInfoVO.setFileNm("");
				rcCstBscInfoVO.setFilePath("");
			}
			if(!cfgCstIdCdMap.isEmpty() && cfgCstIdCdMap.get(cstId) != null){
				rcCstBscInfoVO.setIdCardFileNm(cfgCstIdCdMap.get(cstId).getFileNm());
				rcCstBscInfoVO.setIdCardFilePath(cfgCstIdCdMap.get(cstId).getFilePath());
			}else{
				rcCstBscInfoVO.setIdCardFileNm("");
				rcCstBscInfoVO.setIdCardFilePath("");
			}
		}
		ListPageVO<RcCstBscInfoVO> listPage = new ListPageVO<RcCstBscInfoVO>(list, pager.getTotalCount());
		BaseLogUtils.info(logger, "initList", "查询数据完成. DATA:" + JSONObject.toJSONString(page), CurrentThreadContext.getCurrentUserName());
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getRhAudSts", " 初始化列表.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return listPage;
	}
	/**
	 * 获取配偶信息列表
	* @Title: initList  
	* @Description: 
	* @param @param request
	* @param @param response
	* @param @return    
	* @return Object    
	* @throws
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initSpouseList.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object initSpouseList(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "toListPage", " 初始化列表.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		String dataId = request.getParameter("dataId");
		Pager page = new Pager();
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}

		if (StringUtils.isNotEmpty(pageSize)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}
		RcCstSocialRlQC qc = new RcCstSocialRlQC();
		if(StringUtils.isEmpty(dataId)){
			return new Object();
		}
		qc.setCstId(Long.valueOf(dataId));
		qc.setRlTypCd(PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_GRP_RL_TYP_CD_5));
		List<RcCstSocialRlVO> list = rcCstSocialRlService.searchRcCstSocialRlList(qc);
		if(CollectionUtils.isEmpty(list)){
			return null;
		}
		RcCstSocialRlVO  social = list.get(0);
		String cstNm = social.getRlNm();
		String certNo = social.getCertNo();
		String mp = social.getMp1();
		
		
		RcCstBscInfoQC rqc = new RcCstBscInfoQC();
		rqc.setSysCd(CurrentThreadContext.getFlServiceSysCd());
		rqc.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
		if (StringUtils.isNotEmpty(cstNm)) {
			rqc.setCstNm(cstNm);
		}
		if (StringUtils.isNotEmpty(mp)) {
			rqc.setMp1(mp);
			rqc.setMp2(mp);
		}
		if (StringUtils.isNotEmpty(certNo)) {
			rqc.setCertNo(certNo);
		}
		//加入数据权限
		rqc.setIsAuth(true);
		rqc.setCurrUsrId(CurrentThreadContext.getCurrentUserId());
		rqc.setOpUsrId(CurrentThreadContext.getCurrentUserId());
		page.setCondition(rqc);
		BaseLogUtils.info(logger, "initList", "征信记录查询:page="+JSON.toJSONString(page));
		Pager pager = this.rcCstBscInfoService.searchListPage(page);
		List<RcCstBscInfoVO> rlist = (List<RcCstBscInfoVO>) pager.getResultList();
		
		List<Long> cstIdList = new ArrayList<>();
		//查询图片信息
		List<String> pkList = new ArrayList<String>();
		for (RcCstBscInfoVO rcCstBscInfoVO : rlist) {
			pkList.add(String.valueOf(rcCstBscInfoVO.getId()));
			cstIdList.add(rcCstBscInfoVO.getId());
		}
		//获取授权书关联信息
		getProjectRcCstBseInfo(rlist);
		
		
		SysUlFilesRecQueryCondition condition = new SysUlFilesRecQueryCondition();
		condition.setPkIdList(pkList);
		condition.setSysCd(CurrentThreadContext.getCurrentSysCd());//系统代码-必须条件
		
		List<SysUlFilesRecVO> sysUlFilesRecList = this.sysUlFilesRecService.searchList(condition);
		Map<String, SysUlFilesRecVO> mapRctOne = new HashMap<String, SysUlFilesRecVO>();
		Map<String, SysUlFilesRecVO> mapRctTwo = new HashMap<String, SysUlFilesRecVO>();
		Map<String, SysUlFilesRecVO> cfgCstIdCdMap = new HashMap<>();
		String cfgcdOne = PropertiesCacheUtils.getProperty(UploadConstant.CFG_RCT_CST_BSC_CD);
		String cfgcdTwo = PropertiesCacheUtils.getProperty(UploadConstant.CFG_RCT_LIV_LST_CD);
		String cfgCstIdCd = PropertiesCacheUtils.getProperty(UploadConstant.CFG_CST_ID_CD);
		String cfgDtlCstIdCd = PropertiesCacheUtils.getProperty(UploadConstant.CFG_DTL_CST_ID_CD);
		for (SysUlFilesRecVO sysUlFilesRecVO: sysUlFilesRecList) {
			String pkId = sysUlFilesRecVO.getPkId();
			String cfgcd = sysUlFilesRecVO.getCfgCd();
			String cfgDtlCd = sysUlFilesRecVO.getCfgDtlCd();
			if (cfgcdOne != null && cfgcdOne.equals(cfgcd)) {
				mapRctOne.put(pkId, sysUlFilesRecVO);
			}
			if (cfgcdTwo != null && cfgcdTwo.equals(cfgcd)) {
				mapRctTwo.put(pkId, sysUlFilesRecVO);
			}
			//身份证图片
			if (cfgCstIdCd != null && cfgCstIdCd.equals(cfgcd) && cfgDtlCd.equals(cfgDtlCstIdCd)) {
				cfgCstIdCdMap.put(pkId, sysUlFilesRecVO);
			}
			
		}
		for (RcCstBscInfoVO rcCstBscInfoVO : rlist) {
			String cstId = String.valueOf(rcCstBscInfoVO.getId());
			if (!mapRctOne.isEmpty() && mapRctOne.get(cstId) != null) {
				rcCstBscInfoVO.setAuthFileNm(mapRctOne.get(cstId).getFileNm());
				rcCstBscInfoVO.setAuthFilePath(mapRctOne.get(cstId).getFilePath());
			} else {
				rcCstBscInfoVO.setAuthFileNm("");
				rcCstBscInfoVO.setAuthFilePath("");
			}
			if (!mapRctTwo.isEmpty() && mapRctTwo.get(cstId) != null) {
				rcCstBscInfoVO.setFileNm(mapRctTwo.get(cstId).getFileNm());
				rcCstBscInfoVO.setFilePath(mapRctTwo.get(cstId).getFilePath());
			} else {
				rcCstBscInfoVO.setFileNm("");
				rcCstBscInfoVO.setFilePath("");
			}
			if(!cfgCstIdCdMap.isEmpty() && cfgCstIdCdMap.get(cstId) != null){
				rcCstBscInfoVO.setIdCardFileNm(cfgCstIdCdMap.get(cstId).getFileNm());
				rcCstBscInfoVO.setIdCardFilePath(cfgCstIdCdMap.get(cstId).getFilePath());
			}else{
				rcCstBscInfoVO.setIdCardFileNm("");
				rcCstBscInfoVO.setIdCardFilePath("");
			}
		}
		ListPageVO<RcCstBscInfoVO> listPage = new ListPageVO<RcCstBscInfoVO>(rlist, pager.getTotalCount());
		BaseLogUtils.info(logger, "initList", "查询数据完成. DATA:" + JSONObject.toJSONString(page), CurrentThreadContext.getCurrentUserName());
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getRhAudSts", " 初始化列表.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return listPage;
	}

	private void getProjectRcCstBseInfo(List<RcCstBscInfoVO> list) {
		for(RcCstBscInfoVO info : list){
			String zxFilePathStatus = "0";
			if(null!=info && null!=info.getIsELoa()) {
				zxFilePathStatus = info.getIsELoa() + "";
			}
			info.setZxFilePathStatus(zxFilePathStatus);
		}
	}

	private List<FilSignDTO> getZXFilPath(List<Long> cstIdList) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getZXFilPath", "请求参数：" +  CurrentThreadContext.getCurrentUserName());
		List<FilSignDTO> dto = new ArrayList<>();
		try{
			FilSignQueryCondition qc = new FilSignQueryCondition();
			qc.setFilIdList(cstIdList);
			dto = filSignApiService.getListFilSignByQc(qc);
		}catch(BaseException e){
			BaseLogUtils.error(logger, "getZXFilPath", "查询征信授权书错误："+e.getError(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception e) {
			BaseLogUtils.error(logger, "getZXFilPath", "查询征信授权书异常", CurrentThreadContext.getCurrentUserName(),e);
		}
		if(CollectionUtils.isEmpty(dto)){
			 dto = new ArrayList<>();
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getZXFilPath", "耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return dto;
	}

	/**
	 * 删除数据
	 */
	@RequestMapping(value = "/removeById.do", method = {RequestMethod.POST })
	@ResponseBody
	public DataResultVO removeById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "removeById", " 删除数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_DELETE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			return result;
		}
		try {
			this.rcCstBscInfoService.removeById(Long.valueOf(id));
			BaseLogUtils.info(logger, "removeById", "删除数据.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "removeById", "删除数据失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "removeById", "删除数据失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "removeById", " 删除数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 得到一条记录
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/getById.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object getById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getById", "请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.error(logger, "getById", "获取数据,主键不存在.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		
		try {
			RcCstBscInfoVO vo = this.rcCstBscInfoService.selectById(Long.valueOf(id));
			if(null == vo){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_QUERY_DATA_IS_EMPTY);
				BaseLogUtils.info(logger, "getById", "获取数据,数据不存在.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
			}else{
				//rsklvlcd2为空的情况
				if(StringUtils.isEmpty(vo.getRskLvlCd2())){
					vo.setRskLvlCd2(vo.getRskLvlCd());
				}
			}
			result.setData(vo);
			BaseLogUtils.info(logger, "getById", "获取数据.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
		}catch(BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getById", "获取失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch(Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getById", "获取失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getById", "耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 导出征信记录
	 */
	@RequestMapping(value = "/exportRcCstBscInfo.do", method = {RequestMethod.GET, RequestMethod.POST})
	@ResponseBody
	public DataResultVO exportRcCstBscInfo(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "exportRcCstBscInfo", " 导出征信记录.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_BK_EXPORT_SUCC);
		//设置查询条件？
		String cstNm = request.getParameter("cstNm");
		String mp = request.getParameter("mp");
		String splNm = request.getParameter("splNm");
		String certNo = request.getParameter("certNo");//客户证件号
		String livAudStsCd = request.getParameter("livAudStsCd");//活体状态
		String audStsCd = request.getParameter("audStsCd");//审核状态
		String rskLvlCd2 = request.getParameter("rskLvlCd");//用户级别
		String isReaud = request.getParameter("isReaud");//是否复议
		String isDl = request.getParameter("isDl");//是否死亡
		String prdTyp = request.getParameter("prdTyp");//车型
		String beginDate = request.getParameter("stDt");//开始时间
		String endDate = request.getParameter("endDt");//结束时间
		RcCstBscInfoQC qc = new RcCstBscInfoQC();
		if (StringUtils.isNotEmpty(cstNm)) {
			qc.setCstNm(cstNm);
		}
		if (StringUtils.isNotEmpty(mp)) {
			qc.setMp1(mp);
			qc.setMp2(mp);
		}
		if (StringUtils.isNotEmpty(splNm)) {
			qc.setSplNm(splNm);
		}
		if (StringUtils.isNotEmpty(certNo)) {
			qc.setCertNo(certNo);
		}
		if (StringUtils.isNotEmpty(livAudStsCd)) {
			qc.setLivAudStsCd(livAudStsCd);
		}
		if (StringUtils.isNotEmpty(audStsCd)) {
			qc.setAudStsCd(audStsCd);
		}
		if (StringUtils.isNotEmpty(rskLvlCd2)) {
			qc.setRskLvlCd2(rskLvlCd2);
		}
		if (StringUtils.isNotEmpty(isReaud)) {
			qc.setIsReaud(Integer.valueOf(isReaud));
		}
		if(StringUtils.isNotEmpty(isDl) && StringUtils.isNumeric(isDl)){
			qc.setIsDl(Integer.valueOf(isDl));
		}
		if(StringUtils.isNotBlank(beginDate)){
			Date begin = DateUtils.formatStringToDate(beginDate, DateUtils.YYYY_MM_DD);
			qc.setCrtDtMin(begin);
		}
		if(StringUtils.isNotBlank(endDate)){
			Date end = DateUtils.formatStringToDate(endDate, DateUtils.YYYY_MM_DD);
			qc.setCrtDtMax(end);
		}
		if (StringUtils.isNotEmpty(prdTyp)) {
			qc.setPrdTypCd(prdTyp);
		} else {
			List<String> prdTypCds = new ArrayList<String>();
			prdTypCds.add("1");
			prdTypCds.add("2");
			prdTypCds.add("5");
			prdTypCds.add("7");
			prdTypCds.add("cdd");
			prdTypCds.add("cddunderline");
			prdTypCds.add("lcv");
            prdTypCds.add("nev");
			prdTypCds.add("yqxd");
			qc.setPrdTypCdList(prdTypCds);
		}
		
		try {
			String path = this.rcCstBscInfoService.exportRcCstBscInfo(qc, CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd());
			if(StringUtils.isNotEmpty(path)){
                result.setSuccess(BaseConstant.IS_YESNO_YES);
                result.setInfo(SysLogConstant.LOG_BK_EXPORT_SUCC);
                result.setData(path);
                BaseLogUtils.info(logger, "exportCstList", "导出征信记录数据成功", CurrentThreadContext.getCurrentUserName());
            }
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "exportCstList", "导出征信记录数据失败.ERROR:"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "exportCstList", "导出征信记录数据失败,系统错误..ERROR:"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "exportCstList", " 导出征信记录.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 导出征信记录
	 */
	@RequestMapping(value = "/exportRcCstBscInfoDetail.do", method = {RequestMethod.GET, RequestMethod.POST})
	@ResponseBody
	public DataResultVO exportRcCstBscInfoDetail(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "exportRcCstBscInfoDetail", " 导出征信记录.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_BK_EXPORT_SUCC);
		//设置查询条件？
		String cstNm = request.getParameter("cstNm");
		String mp = request.getParameter("mp");
		String splNm = request.getParameter("splNm");
		String certNo = request.getParameter("certNo");//客户证件号
		String livAudStsCd = request.getParameter("livAudStsCd");//活体状态
		String audStsCd = request.getParameter("audStsCd");//审核状态
		String rskLvlCd2 = request.getParameter("rskLvlCd");//用户级别
		String isReaud = request.getParameter("isReaud");//是否复议
		String isDl = request.getParameter("isDl");//是否死亡
		String prdTyp = request.getParameter("prdTyp");//车型
		String beginDate = request.getParameter("stDt");//开始时间
		String endDate = request.getParameter("endDt");//结束时间
		RcCstBscInfoQC qc = new RcCstBscInfoQC();
		if (StringUtils.isNotEmpty(cstNm)) {
			qc.setCstNm(cstNm);
		}
		if (StringUtils.isNotEmpty(mp)) {
			qc.setMp1(mp);
			qc.setMp2(mp);
		}
		if (StringUtils.isNotEmpty(splNm)) {
			qc.setSplNm(splNm);
		}
		if (StringUtils.isNotEmpty(certNo)) {
			qc.setCertNo(certNo);
		}
		if (StringUtils.isNotEmpty(livAudStsCd)) {
			qc.setLivAudStsCd(livAudStsCd);
		}
		if (StringUtils.isNotEmpty(audStsCd)) {
			qc.setAudStsCd(audStsCd);
		}
		if (StringUtils.isNotEmpty(rskLvlCd2)) {
			qc.setRskLvlCd2(rskLvlCd2);
		}
		if (StringUtils.isNotEmpty(isReaud)) {
			qc.setIsReaud(Integer.valueOf(isReaud));
		}
		if(StringUtils.isNotEmpty(isDl) && StringUtils.isNumeric(isDl)){
			qc.setIsDl(Integer.valueOf(isDl));
		}
		if(StringUtils.isNotBlank(beginDate)){
			Date begin = DateUtils.formatStringToDate(beginDate, DateUtils.YYYY_MM_DD);
			qc.setCrtDtMin(begin);
		}
		if(StringUtils.isNotBlank(endDate)){
			Date end = DateUtils.formatStringToDate(endDate, DateUtils.YYYY_MM_DD);
			qc.setCrtDtMax(end);
		}
		if (StringUtils.isNotEmpty(prdTyp)) {
			qc.setPrdTypCd(prdTyp);
		} else {
			List<String> prdTypCds = new ArrayList<String>();
			prdTypCds.add("1");
			prdTypCds.add("2");
			prdTypCds.add("5");
			prdTypCds.add("7");
			prdTypCds.add("cdd");
			prdTypCds.add("cddunderline");
			prdTypCds.add("lcv");
            prdTypCds.add("nev");
			prdTypCds.add("yqxd");
			qc.setPrdTypCdList(prdTypCds);
		}
		try {
			String path = this.rcCstBscInfoService.exportRcCstBscInfoDetail(qc, CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd());
			if(StringUtils.isNotEmpty(path)){
				result.setSuccess(BaseConstant.IS_YESNO_YES);
				result.setInfo(SysLogConstant.LOG_BK_EXPORT_SUCC);
				result.setData(path);
				BaseLogUtils.info(logger, "exportCstDetailList", "导出征信记录数据成功", CurrentThreadContext.getCurrentUserName());
			}
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "exportCstDetailList", "导出征信记录数据失败.ERROR:"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "exportCstDetailList", "导出征信记录数据失败,系统错误..ERROR:"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "exportRcCstBscInfoDetail", " 导出征信记录.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}
	
	
	/**
	 * 审核前置征信
	 */
	@RequestMapping(value = "/audRcCstBscInfoByIds.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object audRcCstBscInfoByIds(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "audRcCstBscInfoByIds", " 审核前置征信.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String ids = request.getParameter("ids");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, "操作成功！");
		if(StringUtils.isEmpty(ids)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "audRcCstBscInfoByIds", "主键不存在.", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		try {
			List<Long> cstIdList = new ArrayList<>();
			JSONArray jsonArray = JSONArray.parseArray(ids);
			if(null != jsonArray){
				for (Object id : jsonArray) {
					cstIdList.add(Long.valueOf(id.toString()));
				}
			}
			
			if(CollectionUtils.isEmpty(cstIdList)){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo("解析主键后集合仍然为空!");
				BaseLogUtils.info(logger, "audRcCstBscInfoByIds", "解析主键后集合仍然为空!", CurrentThreadContext.getCurrentUserName());
				return result;
			}
			
			this.rcCstBscInfoService.syncRcCstBscInfoAudSts(cstIdList, false);
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "audRcCstBscInfoByIds", "操作失败.[ids="+ids+"]", CurrentThreadContext.getCurrentUserName(), ex);
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("操作失败!");
			BaseLogUtils.error(logger, "audRcCstBscInfoByIds", "操作失败.[ids="+ids+"]", CurrentThreadContext.getCurrentUserName(), ex);
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "audRcCstBscInfoByIds", " 审核前置征信.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}
	
	
	/**
	 * 审核前置征信已死亡数据
	 */
	@RequestMapping(value = "/audIsDlRcCstBscInfoByIds.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object audIsDlRcCstBscInfoByIds(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "audIsDlRcCstBscInfoByIds", " 审核前置征信已死亡数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, "操作成功！");
		try {
			List<Long> cstIdList = new ArrayList<>();
			this.rcCstBscInfoService.syncRcCstBscInfoAudSts(cstIdList, true);
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "audIsDlRcCstBscInfoByIds", "操作失败.", CurrentThreadContext.getCurrentUserName(), ex);
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("操作失败!");
			BaseLogUtils.error(logger, "audIsDlRcCstBscInfoByIds", "操作失败.", CurrentThreadContext.getCurrentUserName(), ex);
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "audIsDlRcCstBscInfoByIds", " 审核前置征信已死亡数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	private void setCstBscInfo(String cstId, ModelAndView view) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "setCstBscInfo", "请求参数：" +  CurrentThreadContext.getCurrentUserName());
		RcCstBscInfoVO vo = this.rcCstBscInfoService.getCstBscInfoById(Long.valueOf(cstId));
		//设置配偶和担保人数据
		//加入附件信息
		JSONObject poObj = new JSONObject();//配偶信息
		JSONArray dbrArray = new JSONArray();//担保人集合
		List<RcCstSocialRlVO> rcCstSocialRlVOList = vo.getRcCstSocialRlVOList();
		if(CollectionUtils.isNotEmpty(rcCstSocialRlVOList)){
			String dbrRlTypCd8 = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_GRP_RL_TYP_CD_8);
			String poRlTypCd5 = PropertiesCacheUtils.getProperty(DictionaryConstant.CODE_GRP_RL_TYP_CD_5);
			JSONObject dbrObj = null;//担保人对象
			for (RcCstSocialRlVO rcCstSocialRlVO : rcCstSocialRlVOList) {
				String soRlNm = rcCstSocialRlVO.getRlNm();
				String soCertNo = rcCstSocialRlVO.getCertNo();
				String soRlTypCd = rcCstSocialRlVO.getRlTypCd();
				String soMp1 = rcCstSocialRlVO.getMp1();
				Long rlId = rcCstSocialRlVO.getId();
				if(poRlTypCd5.equals(soRlTypCd)){
					poObj.put("id", rlId);
					poObj.put("name", soRlNm);
					poObj.put("certNo", soCertNo);
					poObj.put("mp1", soMp1);
				}else if(dbrRlTypCd8.equals(soRlTypCd)){
					dbrObj = new JSONObject();
					dbrObj.put("id", rlId);
					dbrObj.put("name", soRlNm);
					dbrObj.put("certNo", soCertNo);
					dbrObj.put("mp1", soMp1);
					dbrArray.add(dbrObj);
				}
			}
		}
		view.addObject("zx_poid", poObj.toJSONString());
		view.addObject("zx_dbrid", dbrArray.toJSONString());
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "setCstBscInfo", "耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
	}
}

